<%--
  Created by IntelliJ IDEA.
  User: lzy
  Date: 2018/10/13
  Time: 10:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<html>
<head>
    <title>Index</title>
    <script type="text/javascript" src="https://apps.bdimg.com/libs/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#testJson").click(function () {
                var url = this.href;
                var args = {};
                $.post(url, args, function (data) {
                    for (var i = 0; i < data.length; i++) {
                        var id = data[i].id;
                        var lastName = data[i].lastName;
                        alert(id + ":" + lastName);
                    }
                });
                return false;
            })
        })
    </script>
</head>
<body>
<a href="emps">List all employees</a>
<br/><br/>
<a id="testJson" href="testJson">test Json</a>
<hr>
<form action="testHttpMessageConverter" method="post" enctype="multipart/form-data">
    File:<input type="file" name="file"><br/><br/>
    Desc:<input type="text" name="desc"><br/><br/>
    <input type="submit" value="Submit">
</form>
<hr/>
<a href="${pageContext.request.contextPath}/testResponseEntity">test ResponseEntity</a>
<hr/>
<%--
    关于国际化：
    1. 在页面上能够根据浏览器语言设置情况对文本（不是内容），时间，数值进行本地化处理
    2. 可以在bean中获取国际化资源文件Locate对应的消息
    3. 可以通过超链接切换Locate，而不再依赖于浏览器的语言设置情况

    解决：
    1. 使用JSTL的fmt标签就可以
    2. 在bean中注入ResourceBundleMessageSource的梳理，使用其对应的getMessage方法即可
    3. 配置LocalResolver和LocaleChangeInterceptor
--%>
<a href="i18n">I18N PAGE</a>
<hr/>
<form action="testFileUpload" method="post" enctype="multipart/form-data">
    File:<input type="file" name="file"><br/><br/>
    Desc:<input type="text" name="desc"><br/><br/>
    <input type="submit" value="Submit">
</form>
<br/><br/>
<a href="${pageContext.request.contextPath}/testExceptionHandlerExceptionResolver?i=10">test
    ExceptionHandlerExceptionResolver</a>

<br/><br/>
<a href="${pageContext.request.contextPath}/testResponseStatusExceptionResolver?i=10">test
    ResponseStatusExceptionResolver</a>

<br/><br/>
<a href="${pageContext.request.contextPath}/testDefaultHandlerExceptionResolver">test
    DefaultHandlerExceptionResolver</a>

<br/><br/>
<a href="${pageContext.request.contextPath}/testSimpleMappingExceptionResolver?i=2">test
    SimpleMappingExceptionResolver</a>
</body>
</html>
